<!DOCTYPE html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="/common/get-host-info.sub.js"></script>

  <base href="data:/,This is a data URL.">
</head>
<body>
  <script>
    async_test(t => {
      var base = document.querySelector('base');
      var img = new Image();
      img.onload = t.step_func_done(_ => {
        assert_equals(img.naturalWidth, 76, "Image loaded correctly.");
        assert_equals(img.src, "http://127.0.0.1:8000/security/resources/abe.png");
        assert_equals(base.href, 'data:/,This is a data URL.');
      });
      img.onerror = t.unreached_func("Image should have loaded.");

      img.src = "/security/resources/abe.png";
    }, "'data:' is an invalid base URL.");
  </script>
</body>
